<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>选题</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta http-equiv="X-UA-Compatible" content="IE=7">
	<!-- iphone safari -->
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">  
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
	<meta name="apple-mobile-web-app-capable" content="yes" /> 
	<meta name="apple-mobile-web-app-status-bar-style" content="black" />       
	<meta content="black" name="apple-mobile-web-app-status-bar-style" />  
	<meta content="telephone=no" name="format-detection" /> 
	<meta name="Author" contect="Mr.He"/>
    <link rel="apple-touch-icon" size="72x72" href="images/icon.png"/>
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <link rel="stylesheet" type="text/css" href="css/jqm-1.1.1.min.css">
    <link rel="stylesheet" type="text/css" href="css/selectpro.css">
    <script src="js/jquery-1.7.2.min.js"></script>
    <script src="js/jqm-1.1.1.min.js"></script>
    
    <script type="text/javascript">
		var clickAppend=window.localStorage.getItem("imgs")==null?"":window.localStorage.getItem("imgs");
		var clicked=clickAppend.split("#");
		$(document).ready(function(e) {	
			var imgArrays=$("#imgs img");
			$("#tapTest").live("taphold",function(){
				var pwd=prompt("Enter password");
				if(pwd=="c"){
					window.localStorage.removeItem("imgs");
					window.location.reload();
				}
			}).live("click",function(){
				window.location.href='index.html'
			})
			//console.log(clicked);
			$.each(clicked,function(index1,items1){//遍历session存储,点击过的置为灰色
				$.each(imgArrays,function(index2,items2){
					var srcStr=$(items2).attr("src");
					var sign=srcStr.substring(srcStr.indexOf("(")+1,srcStr.lastIndexOf(")"));
					if(sign==items1){
						$(items2).css("visibility","hidden");	
					}
				});
			})
            $("#imgs img").live("tap",function(e){
            	e.preventDefault();
				//console.log(clicked);
				var srcStr=$(this).attr("src");
				var quesId=srcStr.substring(srcStr.indexOf("(")+1,srcStr.lastIndexOf(")"));
				var flag=false;
				$.each(clicked,function(index,items){
					flag=items==quesId?true:false;
				})
				if(!flag){
					clickAppend+="#"+quesId;
				}
				window.localStorage.setItem("imgs",clickAppend);
				window.localStorage.setItem("proId",quesId);
				window.localStorage.removeItem("sign");
				window.location.href="prodetail.html";
			})
			
        });
		window.onresize=function(){
			console.log($("td img").height());
			$("table tr").height($("td img").height());
		}
	
	</script>
</head>

<body data-role="none">
	<div style="margin:0px auto;text-align: center" id="tapTest" ><img src="images/banner.png" width="100%"/></div>
    <div style="margin:15px auto;text-align:center;font-size:24px; color:#099;">请任选一题</div>
    <div id="imgs">
    	<table width="100%" cellpadding="5">
          <tr>
            <td><img src="images/selectPro/1 (1).png"/></td>
            <td><img src="images/selectPro/1 (2).png"/></td>
            <td><img src="images/selectPro/1 (3).png"/></td>
            <td><img src="images/selectPro/1 (4).png"/></td>
            <td><img src="images/selectPro/1 (5).png"/></td>
          </tr>
          <tr>
            <td><img src="images/selectPro/1 (6).png"/></td>
            <td><img src="images/selectPro/1 (7).png"/></td>
            <td><img src="images/selectPro/1 (8).png"/></td>
            <td><img src="images/selectPro/1 (9).png"/></td>
            <td><img src="images/selectPro/1 (10).png"/></td>
          </tr>
          <tr>
            <td><img src="images/selectPro/1 (11).png"/></td>
            <td><img src="images/selectPro/1 (12).png"/></td>
            <td><img src="images/selectPro/1 (13).png"/></td>
            <td><img src="images/selectPro/1 (14).png"/></td>
            <td><img src="images/selectPro/1 (15).png"/></td>
          </tr>
          <tr>
            <td><img src="images/selectPro/1 (16).png"/></td>
            <td><img src="images/selectPro/1 (17).png"/></td>
            <td><img src="images/selectPro/1 (18).png"/></td>
            <td><img src="images/selectPro/1 (19).png"/></td>
            <td><img src="images/selectPro/1 (20).png"/></td>
          </tr>
        </table>
    </div>
</body>
</html>
